﻿Imports System.IO
Imports System.Reflection

Public Class Funciones
    Public Shared Function ObtenerTitular(ByVal Rut As Integer) As String
        Dim objSRM As SRM = New SRM("CLT0", "U062")
        Dim Retorno As String

        objSRM.Invocar("12345678L001L" & Format$(Rut, "000000000"))

        Retorno = IIf(Mid(objSRM.Respuesta, 1, 2) = "00", "True", "Nodo: " & objSRM.Nodo & ", Aplicacion: " & objSRM.Aplicacion & ", Mensaje:" & objSRM.Mensaje & ", Respuesta:" & objSRM.Respuesta & ", StatusSRM:" & objSRM.StatusSrm & ", RetornoSrm:" & objSRM.RetornoSrm)

        ObtenerTitular = Retorno
    End Function

    Public Shared Function AssemblyDirectory() As String
        Return Path.GetDirectoryName(Uri.UnescapeDataString((New UriBuilder(Assembly.GetExecutingAssembly().CodeBase)).Path))
    End Function
End Class
